package com.iflytek.view;/**
 * @Author qing
 * @Date 2022/3/15 15:20
 */

import com.iflytek.bean.Emp;
import com.iflytek.service.EmpService;
import com.iflytek.service.impl.EmpServiceImpl;
import org.junit.Test;

import java.util.List;
import java.util.Scanner;

/**
 * @author qingyunchen
 * @Description
 * @Date: 2022/3/15 15:20
 * @Version 1.0
 */
public class EmpMain {
    static Scanner sc = new Scanner(System.in);
    static EmpService empService=new EmpServiceImpl();

    public static void main(String [] args){
        System.out.println("======================================");
        System.out.println("======********员⼯管理系统********=======");
        System.out.println("======================================");
        menu();
    }
    private  static void menu(){
        System.out.println("请输⼊相应操作序号:1.员⼯列表 2.增加员⼯ 3.修改员⼯信息 4.删除员⼯ 5.根据员⼯姓名模糊查询 6.退出");
        System.out.print(":");
        int num=sc.nextInt();
        switch (num) {
            case  1:
                List<Emp> empList = empService.getAllEmp();
                for (Emp emp : empList) {
                    System.out.println(emp);
                }
                break;
            case  2:
                Emp emp = null;
                empService.addEmp(emp);
                break;
            case  3:
                int empno = 0;
                empService.upDate(empno);
                break;
            case  4:
                int empno1 = 0;
                empService.delEmpById(empno1);
                break;
            case  5:
                int empno2=0;
                List<Emp> query = empService.selectLikeName(empno2);
                for (Emp e : query) {
                    System.out.println(e);
                }
                break;
            case  6:
                empService.exit();
                break;

        }
    }
}